<div class="modal-dialog" style="width: 450px;padding-top: 200px">
    <div class="modal-content">
        <div class="modal-header">
            <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
                &times;
            </button>
            <h4 class="modal-title" id="myModalLabel">
                更改兑换码状态
            </h4>
        </div>
        <div class="modal-body">
            <h4>请选择兑换码 <span style="color: #ff3f4b"> {$res['serial']} </span>的状态</h4><br>
            <input type="radio" name="status" id="s1" {if $res['status']==1}checked{/if}> <label for="s1">未兑换</label>&nbsp;&nbsp;&nbsp;&nbsp;
            <input type="radio" name="status" id="s2" {if $res['status']==2}checked{/if}> <label for="s2">已兑换</label>&nbsp;&nbsp;&nbsp;&nbsp;
        </div>
        <script type="text/javascript">

            $(document).ready(function () {
                var url = "{php echo webUrl('exchange/coupon/status');}";
                var code = '&key={$key}&ajax=1&status={$res["status"]}&';
                var str = 'newstatus={$res["status"]}';
                var link = '';
                $('#s0').click(function () {
                    str = 'newstatus=0';
                    link = url+code+str;
                });
                $('#s1').click(function () {
                    str = 'newstatus=1';
                    link = url+code+str;
                });
                $('#s2').click(function () {
                    str = 'newstatus=2';
                    link = url+code+str;
                });
                $('#save').click(function () {
                    htmlobj = $.ajax({url:link,async:false});
                    location.reload();
                });
            });

        </script>
        <div class="modal-footer">
            <button class="btn btn-primary" href="" id="save" data-href="" data-toggle="ajax">
                保存
            </button>
            <button type="button" class="btn btn-default" data-dismiss="modal">关闭
            </button>
        </div>
    </div>
</div>
